class CommercialBank {
  public address: string = "beijing";
  public name: string = "wangwu";
  static count: number;

  constructor(name: string, address: string) {
    this.address = address;
    this.name = name;
  }

  loan(): void {
    console.log(this.name + "银行贷款");
  }
}

type ConstructorType = new (...args: any[]) => any;
// 构造函数签名的另一种表示形式
interface ConstructorInter {
  new (...args: any[]): any;
}

// 泛型工程函数
// function creatFactoryConstructor(constructorType: new (...args: any[]) => any) {
// function creatFactoryConstructor(constructorType: ConstructorInter) {
function creatFactoryConstructor(constructorType: ConstructorType) {
  // 装饰器模式
  console.log(constructorType.name + "被创建....");
  new constructorType();
}

creatFactoryConstructor(CommercialBank);

export {};
